<?
class Contactousr {

	var $id_contacto_usr;
	var $telefono;	
	var $celular;
	var $email1;	
	var $email2;

	 function __construct($telefono=0,$celular=0,$email1="",$email2="") {
	 	$this->telefono=$telefono;
		$this->celular=$celular;
		$this->email1=$email1;
		$this->email2=$email2;	
	}

	function seleccion_todo_contacto_usr($con){
		$strselect="SELECT * FROM contactousr;";
		$resultado = mysql_query($strselect,$con);
		return $resultado;
	}
	
	function seleccion_contacto_usr($con){
		$strselect="SELECT * FROM contactousr WHERE id = '$this->id_contacto_usr';";
		$resultado = mysql_query($strselect,$con);
		return $resultado;
	}
		
	function eliminar_contacto_usr($con) {
		$strdelete="delete from contactousr where id='$this->id_contacto_usr';";
		mysql_query($strdelete,$con) or die (mysql_error());
	}
	function modificar_usuario($con){
		$srtupdate="UPDATE contactousr SET telefono='$this->telefono' celular='$this->celular'  mail1='$this->mail1' mail2='$this->mail2' where id='$this->id_contacto_usr'";
		mysql_query($srtupdate,$con) or die (mysql_error());
	}
	function insertar_usuario($con) {
		$strinsert="insert into contactousr (telefono, celular, email1, email2) values('$this->telefono','$this->celular','$this->email1','$this->email2');";				
		mysql_query($strinsert,$con) or die (mysql_error())	;	
	}
	
	function asignar_usuario($telefono,$celular,$email1,$email2){
		$this->telefono=$telefono;
		$this->celular=$celular;
		$this->email1=$email1;
		$this->email2=$email2;	
	}
	


}
?>